package com.tanhua.model.vo;


import com.tanhua.model.domian.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class FriendsVo {
    private Integer id; //用户id
    private String avatar; //用户头像
    private String nickname; //昵称
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String education; //学历
    private Integer marriage; //婚姻状态（0未婚，1已婚）

    private Integer matchRate; //缘分值
    private boolean alreadyLove; //是否喜欢ta
    //private String birthday; //生日
    //private String income; //收入
    //private String profession; //行业
    //private String tags; //用户标签：多个用逗号分隔
    //private String coverPic; // 封面图片

    public static FriendsVo init(UserInfo userInfo) {
        FriendsVo vo = new FriendsVo();
        BeanUtils.copyProperties(userInfo, vo);
        vo.setId(Integer.valueOf(userInfo.getId().toString()));
        if (userInfo.getAge() == null){
            vo.setAge(20);
        }else {
            vo.setAge(userInfo.getAge());
        }
        return vo;
    }
}

